package org.luxor.commons.workflow.entity;

import javax.validation.constraints.NotBlank;
import java.util.Date;

/**
 * 已办任务列表-查询参数
 *
 * @author Mr.yan  @date 2021/10/17
 */
public class DoneTaskQuery {

    /**
     * 当前页数
     */
    private int current = 1;

    /**
     * 每页记录数
     */
    private int size = 25;

    /**
     * 用户ID（办理人）
     */
    @NotBlank
    private String userId;

    /**
     * 租户
     */
    private String tenantId;

    /**
     * 分类
     */
    private String category;

    /**
     * 任务名称(LIKE)
     */
    private String taskName;

    /**
     * 任务生成时间起
     */
    private Date startTime;

    /**
     * 任务生成时间止
     */
    private Date endTime;

    public DoneTaskQuery() {
    }

    public int getCurrent() {
        return current;
    }

    public void setCurrent(int current) {
        if (current <= 0) {
            this.current = 1;
        } else {
            this.current = current;
        }
    }

    public int getSize() {
        return size;
    }

    public void setSize(int size) {
        this.size = size;
    }

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public String getTenantId() {
        return tenantId;
    }

    public void setTenantId(String tenantId) {
        this.tenantId = tenantId;
    }

    public String getCategory() {
        return category;
    }

    public void setCategory(String category) {
        this.category = category;
    }

    public String getTaskName() {
        return taskName;
    }

    public void setTaskName(String taskName) {
        this.taskName = taskName;
    }

    public Date getStartTime() {
        return startTime;
    }

    public void setStartTime(Date startTime) {
        this.startTime = startTime;
    }

    public Date getEndTime() {
        return endTime;
    }

    public void setEndTime(Date endTime) {
        this.endTime = endTime;
    }

    @Override
    public String toString() {
        return "TaskListQuery{" +
                "current=" + current +
                ", size=" + size +
                ", userId='" + userId + '\'' +
                ", tenantId='" + tenantId + '\'' +
                ", category='" + category + '\'' +
                ", taskName='" + taskName + '\'' +
                ", startTime=" + startTime +
                ", endTime=" + endTime +
                '}';
    }
}
